package com.javabasic.algorithm.newcode;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Scanner;

/**
 * @Author xiongmin
 * @Description //TODO
 * @Date 2020/9/5 18:05
 * @Version 1.0
 **/
public class 排列 {

    static Scanner cin = new Scanner(System.in);

    public static void main(String[] args) {
        long n, m, k;
        n = cin.nextLong();
        m = cin.nextLong();
        k = cin.nextLong();
        ArrayList<Range> array = new ArrayList<>();
        int start, end;
        Range range = null;
        for (long i = 0; i < m; i++) {
            start = cin.nextInt();
            end = cin.nextInt();
            range = new Range(start, end);
            array.add(range);
        }
        if (!array.isEmpty()) {
            StringBuilder str = new StringBuilder("");
            for (long i = 1; i <= n; i++) {
                str.append((char) ('0' + i));
            }
            StringBuilder temp;
            LinkedHashMap<String, Long> map = new LinkedHashMap<>();
            long tag, cycle;
            for (long i = 0; i < k; i++) {
                for (Range range1 : array) {
                    temp = new StringBuilder(str.substring(range1.start - 1, range1.end));
                    temp.reverse();
                    str = str.replace(range1.start - 1, range1.end, temp.toString());
                }
                if (map.containsKey(str.toString())) {
                    tag = map.get(str.toString());
                    cycle = i+1 - tag;
                    long l = ((k - (tag - 1)) % cycle);
                    if (l== 0) {
                        l = cycle + tag-1;
                    }
                    boolean flag = false;
                    for (String key : map.keySet()) {
                        if (map.get(key) == l) {
                            str = new StringBuilder(key);
                            flag = true;
                            break;
                        }
                    }
                    if (flag){
                        break;
                    }
                } else {
                    map.put(str.toString(), i + 1);
                }
            }
            int len = str.length();
            for (int i = 0; i < len; i++) {
                if (i != len - 1) {
                    System.out.print(str.charAt(i) + " ");
                } else {
                    System.out.print(str.charAt(i));
                }
            }
        } else {
            for (long i = 1; i <= n; i++) {
                if (i != n) {
                    System.out.print(i + " ");
                } else {
                    System.out.print(i);
                }
            }
        }
    }
}

/**
 * 5 2 1
 * 1 4
 * 2 3
 *
 * 8 2 12
 * 2 4
 * 3 6
 */
class Range {
    int start;
    int end;

    public int getStart() {
        return start;
    }

    public void setStart(int start) {
        this.start = start;
    }

    public int getEnd() {
        return end;
    }

    public void setEnd(int end) {
        this.end = end;
    }

    public Range() {
    }

    public Range(int start, int end) {
        this.start = start;
        this.end = end;
    }
}
